// 封装和企业有关的函数接口
import request from '@/utils/request'

/**
 * 获取企业列表
 * @param { page, pageSize} params
 * @returns
 */
export function getEnterpriseListAPI(obj) {
  return request({
    url: '/park/enterprise',
    method:'GET',
    params: obj
  })
}

/**
 * 获取行业列表
 * @returns
 */
export function getIndustryListAPI() {
    return request({
      url: '/park/industry',
      method:'GET'
    })
  }

  /**
 * 上传合同
 * @returns
 */
//上传的数据类型为FormData时 必须用实例方法
// const fd=new FormData()
// fd.append('file', 选择的文件)
// fd.append('type', 'businessLicense')
// uploadAPI(fd)

export function uploadAPI(obj) {
    return request({
      url: '/upload',
      method: 'POST',
      data: obj
    })
  }
  

  export function addEnterpriseAPI(obj){
    return request({
        url:'/park/enterprise',
        method: 'POST',
        data: obj
    })
    
  }

  export function getEnterpriseDetailAPI(id){
    return request({
        url: '/park/enterprise/' + id,
    method: 'GET',
    
    })
    
    
  }

  export function editEnterpriseAPI(obj){
    return request({
        url: '/park/enterprise',
        method: 'PUT',
        data: obj
    })
  }

  export function delEnterpriseAPI(id){
    return request({
        url:'/park/enterprise/' + id,
        method:'DELETE',
    })
  }